package com.yinhd.study.sple;

import com.yinhd.study.customLog.LogController;
import com.yinhd.study.customLog.LogDTO;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.expression.Expression;
import org.springframework.expression.ExpressionParser;
import org.springframework.expression.ParserContext;
import org.springframework.expression.spel.SpelParserConfiguration;
import org.springframework.expression.spel.standard.SpelExpressionParser;

/**
 * @program: study
 * @description:
 * @Author: yinhd
 * @create: 2022-02-14 11:17
 **/
public class Test {

    public static void main(String[] args) {
        LogDTO logDTO = new LogDTO();
        logDTO.setName("yinhd");
        logDTO.setPassword("1111");

        ExpressionParser parser = new SpelExpressionParser();
        ParserContext context;
        Expression expression = parser.parseExpression("name.concat('!')");
        String value = (String) expression.getValue(logDTO);
        System.out.println(value);
    }

}
